package client.window;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;

public class ListenerQuitter extends WindowAdapter
{
	MainFrame mf;
	public ListenerQuitter(MainFrame mf)
	{
		this.mf = mf;
	}
	
	@Override
	public void windowClosing(WindowEvent e) 
	{
		super.windowClosing(e);
		try 
		{
			mf.getClient().getSocket().close();
		} 
		catch (IOException e1) 
		{
			e1.printStackTrace();
		}
		System.exit(0);
	}
}
